﻿using System.Security.Principal;
using HelperTools;
using Interfaces.Models;

namespace Framework.Security
{
    public class EISSessionIdentity : IIdentity
    {
        private readonly ISession _session;

        public ISession Session
        {
            get
            {
                return _session;
            }
        }

        public EISSessionIdentity(ISession session)
        {
            _session = session;
            Name = _session.With(x => x.User).With(x => x.UserName);
            IsAuthenticated = true;
        }
        
        public string Name { get; private set; }
        
        public string AuthenticationType { get; private set; }
        
        public bool IsAuthenticated { get; private set; }
    }
}
